package com.hunliji.monitor.manager.impl;

import com.hunliji.monitor.manager.api.GitlabManager;
import com.hunliji.monitor.manager.api.model.dto.gitlab.GitlabDiscussion;
import com.hunliji.monitor.manager.api.model.dto.gitlab.GitlabUser;
import com.hunliji.monitor.manager.rest.GitLabRest;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author banxuan
 * Date : 2023/10/19
 * Time : 19:05
 */
@Component
public class GitlabManagerImpl implements GitlabManager {
    @Resource
    GitLabRest gitLabRest;
    private static String token =  "rssitxo5YD2n8YToQcHi";
    @Override
    public GitlabDiscussion getDiscussion(int projectId, int mergeRequestId, String discussionId) {
        GitlabDiscussion discussion = gitLabRest.getDiscussion(projectId, mergeRequestId, discussionId, token);
        return discussion;
    }

    @Override
    public GitlabUser getUserInfo(int userId) {
        return gitLabRest.getUserInfo(userId, token);
    }
}
